/*
 * UART.h
 *
 *  Created on: Nov 11, 2020
 *      Author: Jiarun
 */
#ifndef __UART_H
#define __UART_H

/* ----------------------------------Includes --------------------------------*/
#include "main.h"
#include "stm32f1xx_hal_uart.h"
#include <string.h>


class UART
{
public:
		UART_HandleTypeDef uart;
		uint8_t Rx_conut;
		static USART_TypeDef* USART_Print;
		
		UART(USART_TypeDef *USART, uint32_t Preempt, uint32_t Sub, int32_t BaudRate = 115200);
		~UART();
		
		void using_print();
		void operator<<(uint8_t* str);
		void operator<<(const char* str);
		
private:
    IRQn_Type USART_IRQn;
    IRQn_Type decideUSART_IRQn(USART_TypeDef *USART);
};

#ifdef __cplusplus
 extern "C" {
#endif




	
	 
	 
#ifdef __cplusplus
}
#endif

#endif /* __UART_H */
